// user.js
import { defineStore } from 'pinia'
import * as storage from "@/common/storage"
 
export const userStore = defineStore({
  id: 'user',
  state: () => ({
    userInfo: storage.getUserInfo(),
	token: storage.getToken()
  }),
  actions: {
    setUserInfo(info:any) {
		this.userInfo = info
		storage.setUserInfo(info)
    },
	setToken(token:string){
		this.token = token
		storage.setToken(token)
	}
  }
})